package com.mlh.bitwise;

/**
 * @author 缪林辉
 * @date 2024/10/16 11:25
 * @DESCRIPTION
 */
public class BitUtils {
    public static String printBit(int num){
        StringBuilder sb = new StringBuilder(32);
        for (int i = 0; i < 32; i++) {
            int count=num&1;
            if(i%8==0){
                sb.append(",");
            }
            sb.append(count);
            num>>>=1;
        }
        sb.reverse();
        sb.deleteCharAt(sb.length()-1);
        return sb.toString();
    }
}
